/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ({

/***/ "./src/cate.js":
/*!*********************!*\
  !*** ./src/cate.js ***!
  \*********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("var home = __webpack_require__(/*! ./controllers/cate-list.js */ \"./src/controllers/cate-list.js\");\n\n//# sourceURL=webpack:///./src/cate.js?");

/***/ }),

/***/ "./src/controllers/cate-list.js":
/*!**************************************!*\
  !*** ./src/controllers/cate-list.js ***!
  \**************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("var cateListTpl = __webpack_require__(/*! ../views/cate-list.html */ \"./src/views/cate-list.html\");\n\nvar navTpl = __webpack_require__(/*! ../views/nav.html */ \"./src/views/nav.html\");\n\nvar leftTpl = __webpack_require__(/*! ../views/cate-list-left.html */ \"./src/views/cate-list-left.html\");\n\nvar rightTpl = __webpack_require__(/*! ../views/cate-list-right.html */ \"./src/views/cate-list-right.html\");\n\n$(\"#cate\").html(cateListTpl);\n$(\"#footer\").html(navTpl);\n\nvar fetch = __webpack_require__(/*! ../models/fetch.js */ \"./src/models/fetch.js\")[\"default\"];\n\nvar dataArr = [];\nfetch.jsonp(\"cateApi/cate/catelist?pf=8&area=4&bi=222&dtype=jsonp&_=1560045878699&callback=jsonp2\", \"cb\").then(function (res) {\n  dataArr = res;\n  var renderLeftTpl = template.render(leftTpl, {\n    res: res\n  });\n  $('#cate-list-left').html(renderLeftTpl);\n  var data = res[0].secondCateList;\n  renderRight(data, 0);\n  $('#cate-list-left').on(\"click\", 'li', onCateClick);\n});\n\nfunction onCateClick() {\n  var id = $(this).attr(\"data-id\");\n  if (dataArr.length <= 0) return false;\n  dataArr.some(function (elem, index) {\n    if (elem.id == id) {\n      console.log(1);\n      renderRight(elem.secondCateList, index);\n      return true;\n    }\n  });\n}\n\nfunction renderRight(data, index) {\n  console.log(data, index);\n  var renderRightTpl = template.render(rightTpl, {\n    data: data\n  });\n  $('#cate-list-right').html(renderRightTpl);\n  $('#cate-list-left li').eq(index).addClass('active').siblings().removeClass('active');\n} // async function getCateData(){\n//     let dataJson=await fetch.getData('cateApi/cate/catelist?pf=8&area=4&bi=222&dtype=jsonp&_=1560045878699&callback=jsonp2');\n//     let data=JSON.parse(dataJson);\n//     console.log(data.responseText);\n//     console.log(data);\n// }\n// getCateData();\n// https://shop.juanpi.com/gsort?key=%7B%22cdt%22%3A%7B%22is_show_presale%22%3A%220%22%2C%22activity_type%22%3A%5B%221%22%2C%223%22%2C%225%22%2C%226%22%2C%2220%22%5D%2C%22hot_show_type%22%3A1%2C%22fcate%22%3A%222109%22%2C%22sale_type%22%3A2%7D%2C%22order%22%3A%7B%22show_stime%22%3A%22desc%22%2C%22sales%22%3A%22desc%22%2C%22fav%22%3A%22desc%22%2C%22sort%22%3A%22desc%22%2C%22cprice%22%3A%22desc%22%7D%7D&type=50&zhouyi_ids=p8_c4_l4&machining=danpin&page=2&rows=10&dtype=JSONP&price_range=&cat_threeids=&filter_id=&callback=gsort_callback\n\n//# sourceURL=webpack:///./src/controllers/cate-list.js?");

/***/ }),

/***/ "./src/models/fetch.js":
/*!*****************************!*\
  !*** ./src/models/fetch.js ***!
  \*****************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n  getData: function getData(url) {\n    return $.ajax({\n      url: url,\n      type: \"get\",\n      success: function success(result) {\n        return result;\n      }\n    });\n  },\n  jsonp: function jsonp(url, cb_key, data) {\n    // 给 后端接受的字段一个默认值;\n    cb_key = !cb_key ? \"callback\" : cb_key; // 给data一个默认值防止出错：\n\n    data = !data ? {} : data;\n    return new Promise(function (resove, reject) {\n      var cb_name = \"gp10\" + Date.now(); // 回调函数\n\n      window[cb_name] = function (res) {\n        resove(res);\n      };\n\n      var script = document.createElement(\"script\"); // url问号判断;\n\n      url += /\\?/.test(url) ? \"\" : \"?\"; //先拼接 回调函数名;\n\n      url += cb_key + \"=\" + cb_name;\n\n      for (var key in data) {\n        url += \"&\".concat(key, \"=\").concat(data[key]);\n      }\n\n      console.log(url);\n      script.src = url;\n      document.body.appendChild(script);\n\n      script.onload = function () {\n        this.remove();\n      };\n    });\n  }\n});\n\n//# sourceURL=webpack:///./src/models/fetch.js?");

/***/ }),

/***/ "./src/views/cate-list-left.html":
/*!***************************************!*\
  !*** ./src/views/cate-list-left.html ***!
  \***************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = \"{{each res}}<li data-id=\\\"{{$value[\\'id\\']}}\\\">    <span>{{$value[\\'name\\']}}</span></li>{{/each}}\"\n\n//# sourceURL=webpack:///./src/views/cate-list-left.html?");

/***/ }),

/***/ "./src/views/cate-list-right.html":
/*!****************************************!*\
  !*** ./src/views/cate-list-right.html ***!
  \****************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = \"{{each data}}<li data-id=\\\"{{$value[\\'id\\']}}\\\">    <a href=\\\"\\\">        <div>            <img src=\\\"cdnApi{{$value[\\'icon\\']}}\\\" alt=\\\"\\\">        </div>        <span>{{$value[\\'name\\']}}</span>    </a></li>{{/each}}\"\n\n//# sourceURL=webpack:///./src/views/cate-list-right.html?");

/***/ }),

/***/ "./src/views/cate-list.html":
/*!**********************************!*\
  !*** ./src/views/cate-list.html ***!
  \**********************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = \"<div class=\\\"cate-container\\\">    <main>        <div class=\\\"list\\\">            <div class=\\\"search\\\">                <a href=\\\"###\\\">                    <i class=\\\"yo-ico\\\">&#xe60b;</i>                    <span>搜索商品</span>                </a>            </div>            <div class=\\\"content\\\">                <div class=\\\"left\\\">                    <ul id=\\\"cate-list-left\\\">                                            </ul>                </div>                <div class=\\\"right\\\">                    <ul id=\\\"cate-list-right\\\">                                            </ul>                </div>            </div>        </div>    </main>    <div id=\\'footer\\'></div></div>\"\n\n//# sourceURL=webpack:///./src/views/cate-list.html?");

/***/ }),

/***/ "./src/views/nav.html":
/*!****************************!*\
  !*** ./src/views/nav.html ***!
  \****************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = \"<nav>    <div class=\\\"active\\\">        <i class=\\\"yo-ico\\\">&#xe646;</i>        <p>首页</p>    </div>    <div>        <i class=\\\"yo-ico\\\">&#xe61b;</i>        <p>分类</p>    </div>    <div>        <i class=\\\"yo-ico\\\">&#xe64c;</i>        <p>购物车</p>    </div>    <div>        <i class=\\\"yo-ico\\\">&#xe62f;</i>        <p>我的卷皮</p>    </div></nav>\"\n\n//# sourceURL=webpack:///./src/views/nav.html?");

/***/ }),

/***/ 1:
/*!***************************!*\
  !*** multi ./src/cate.js ***!
  \***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("module.exports = __webpack_require__(/*! ./src/cate.js */\"./src/cate.js\");\n\n\n//# sourceURL=webpack:///multi_./src/cate.js?");

/***/ })

/******/ });